package cn.lei.uicontrols;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.RatingBar;
import android.widget.Toast;

public class AtyUsingRatingBar extends AppCompatActivity {

    private RatingBar mRatingBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_aty_using_rating_bar);

        mRatingBar = (RatingBar) findViewById(R.id.ratingBar5);
        mRatingBar.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() {
            @Override
            public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) {
                Toast.makeText(AtyUsingRatingBar.this, "评价为：" + rating, Toast.LENGTH_SHORT).show();
            }
        });
    }
}
